<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%  
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>  
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>比电影</title>
	<base href="<%=basePath%>">
	<!-- 网页图标 -->  
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />  
	<link rel="SHORTCUT ICON" href="images/favicon.ico" />
	
    <!-- Bootstrap core CSS -->
   	<link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.default.css" rel="stylesheet">
    <link href="css/bootstrap-districtpicker.css" rel="stylesheet">
  </head>

  <body>
    <nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="index">BI Dianying</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="index">首页</a></li>
            <li><a>比价格</a></li>
            <li><a>热门活动</a></li>
            <li><a>经典影评</a></li>
          </ul>
          <ul class="nav navbar-nav" style="float: right;">
            <li ><a href='tencent://message/?uin=516511915'>联系作者</a></li>
          </ul>
        </div><!-- /.nav-collapse -->
      </div><!-- /.container -->
    </nav><!-- /.navbar -->

    <div class="container">
      <div class="row">
   		<div class="citySelect">
      		<span class="font18">当前城市：</span>
      		<a href="javascript:void(0)" class="font20" id="cityName">${cityName}</a>
   		</div>
        <div class="jumbotron">
          <div class="row">
          	<c:forEach items="${resultData.data}" var="li">
			<div class="col-md-2">
       		  	<a href="#" class="thumbnail">
			      <img width="150" height="200" src="${li.picLinks}">
			      <span class="title">${li.title }</span>
			      <span class="grade">${li.grade }</span>
			    </a>  
			    <div class="caption">
		        	<p><a href="${li.href}" class="btn btn-primary btn-block" role="button">比比价格</a></p>
			    </div>
			  </div>
		</c:forEach>
  	</div>
        </div>
      </div><!--/row-->

      <hr>


    </div><!--/.container-->
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="js/ie10-viewport-bug-workaround.js"></script>
    <script src="js/custom/bootstrap-districtpicker.js"></script>
    <script src="js/custom/data.js"></script>
    <script src="js/custom/cookie.js"></script>
    
    
	<script type="text/javascript">
	$(function() {
		$('#cityName').citypicker({
			url:'gewara/getCity.htm',
	        callback: function(city) {
	            $.cookie('citycode', city.code, { expires: 7 });
	            window.location.href='./index'
	        },
	        dataHandler: function(data) {
	            return $.map(data, function(city) {
	               var cityNew =  $.extend({ hot:false }, city); 
	               console.log(city.pinyin);
	               if(cityNew.pinyin == 'shenzhen'||cityNew.pinyin == 'beijing'||cityNew.pinyin == 'shanghai'||cityNew.pinyin == 'guangzhou'||cityNew.pinyin == 'wuhan'||cityNew.pinyin == 'chengdu'||cityNew.pinyin == 'changsha'||cityNew.pinyin == 'tianjin'||cityNew.pinyin == 'hangzhou'||cityNew.pinyin == 'nanjing'||cityNew.pinyin == 'xiamen'||cityNew.pinyin == 'xian'||cityNew.pinyin == 'zhengzhou'){
	            	   cityNew.hot = true;
	               }
	               return cityNew;
	            });
	        },
	        showHot:true
	    }); 
	})
	</script>
    
	
  </body>
</html>
